@extends('layouts.app')

@section('content')
	{{--<div data-options="region:'center'"  class="easy_center">
		<div id="tt" class="easyui-tabs" style="width:100%;" data-options="border:false,fit:true,plain:true">
			<div title="首页"></div>
		</div>
	</div>--}}
	<div class="main-content">
		@if(auth::user()->role_id != 22)
		<div class="search_inp">
			<table width="100%" border="1" class="table_search">
				<thead>
					<tr>
						<th colspan="6">
							<span>查询条件</span>
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td width="13.33%" align="right"><label>单位名称：</label></td>
						<td width="20%"><input type="text" class="w150" name="name" placeholder="请输入单位关键字"/></td>
						<td width="13.33%" align="right"><label>联系人：</label></td>
						<td width="20%"><input type="text" class="w150" name="frdb_name" placeholder="请输入联系人全名"/></td>
						<td width="13.33%" align="right"><label>企业类型：</label></td>
						<td width="20%">
							<select name="type" class="w150">
								<option value="">请选择企业类型</option>
								@foreach($type as $v)
									<option value="{{$v->id}}">{{$v->name}}</option>
								@endforeach
							</select>
						</td>
					</tr>
					<tr>
						<td width="13.33%" align="right"><label>重点级别：</label></td>
						<td width="20%">
							<select name="jibie" class="w150">
								<option value="">请选择重点级别</option>
								<option value="0">非重点</option>
								<option value="1">省级</option>
								<option value="2">市级</option>
								<option value="3">县级</option>
								<option value="4">乡级</option>
							</select>
						</td>
						{{--<td width="13.33%" align="right"><label>是否认领：</label></td>
						<td width="20%">
							<select name="is_renling" class="w150">
								<option value="">请选择是否认领</option>
								<option value="1">是</option>
								<option value="0">否</option>
							</select>
						</td>--}}
						<td width="13.33%" align="right"></td>
						<td width="20%">
							<input type="hidden" name="city" value=""/>
							<input type="hidden" name="area" value=""/>
							<input type="hidden" name="org_id" value=""/>
							<a href="javascript:" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:80px" onclick="doSearch()">查询</a>
						</td>
						<td></td><td></td>
					</tr>
				</tbody>
			</table>
		</div>

		@else
				
				<!-- <div id="tabs" class="easyui-tabs" style="width:100%;height:720px;position:relative;">
					<a href="javascript:history.back(-1);" class="easyui-linkbutton forback" plain="true" iconCls="icon-back">返回</a>
				</div>
				
				<script type="text/javascript">
				function addTab(title, url){
					if ($('#tabs').tabs('exists', title)){
						$('#tabs').tabs('select', title);
					} else {
						var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;min-height:700px;height:100%;margin-top:2px;"></iframe>';
						$('#tabs').tabs('add',{
							title:title,
							content:content,
							closable:false
						});
					}
				}
				//加载页面
				$(document).ready(function(){
				  addTab('基本信息',"{{url('admin/units/edit',auth::user()->unit_id)}}");
				  addTab('法人登记',"{{url('admin/units/faren',auth::user()->unit_id)}}");
				  addTab('保卫人员登记',"{{url('admin/units/baowei',auth::user()->unit_id)}}");
				  addTab('重点岗位人员登记',"{{url('admin/units/zdry',auth::user()->unit_id)}}");
				  addTab('重要部位登记',"{{url('admin/units/zybw',auth::user()->unit_id)}}");
				  $('#tabs').find('.panel-htop').children('.panel-body').css('overflow','hidden');
				})
				</script>
 -->
 			 <div id="taby" class="easyui-tabs" border="false" style="width:100%;height:720px;overflow: hidden;">

		        <div title="基本情况" style="overflow:hidden">
		            <iframe scrolling="yes" frameborder="0"  src="{{url('admin/units/edit',auth::user()->unit_id)}}" style="width:100%;height:100%;"></iframe>
		        </div>
		        <div title="法人登记" style="overflow:hidden">
		            <iframe scrolling="yes" frameborder="0"  src="{{url('admin/units/faren',auth::user()->unit_id)}}" style="width:100%;height:100%;"></iframe>
		        </div>
		        <div title="保卫人员登记" style="overflow:hidden">
		            <iframe scrolling="yes" frameborder="0"  src="{{url('admin/units/baowei',auth::user()->unit_id)}}" style="width:100%;height:100%;"></iframe>
		        </div>
		        <div title="重点岗位人员登记" style="overflow:hidden">
		            <iframe scrolling="yes" frameborder="0"  src="{{url('admin/units/zdry',auth::user()->unit_id)}}" style="width:100%;height:100%;"></iframe>
		        </div>
		        <div title="重要部位登记" style="overflow:hidden">
		            <iframe scrolling="yes" frameborder="0"  src="{{url('admin/units/zybw',auth::user()->unit_id)}}" style="width:100%;height:100%;"></iframe>
		        </div>
		        
		    </div>
		  </div>



				
		@endif



		@if(auth::user()->role_id != 22)
		<div class="btn-toolbar list-toolbar">
			<div class="form-all mg_t30">
				<div id="tb">
					@if(Auth::guard('admin')->user()->role_id != 22)
					<!-- <a class="easyui-linkbutton" iconCls="icon-add" onclick="add()" plain="true">新增</a> -->
					@endif
					<a class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="edit()">查看雷达图</a>
					{{--<a class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="cancel()">注销</a>
					<a class="easyui-linkbutton" iconCls="icon-print" plain="true" onclick="print()">打印</a>--}}
				<!-- 	<a class="easyui-linkbutton" iconCls="icon-large-smartart" plain="true" onclick="export_unit()">导出</a> -->

					{{--@if(Auth::guard('admin')->user()->role_id != 22)
					<a class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="add()">新增</a>
					@endif--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-tip" plain="true" onclick="st()">重点级别设置</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="jump1()">法人登记</a>}}
					{{--<a class="easyui-linkbutton" iconCls="icon-bw" plain="true" onclick="jump2()">保卫人员登记</a>}}
					{{--<a class="easyui-linkbutton" iconCls="icon-zd" plain="true" onclick="jump3()">重点岗位人员登记</a>}}
					{{--<a class="easyui-linkbutton" iconCls="icon-jg" plain="true" onclick="jump4()">保卫机构</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-zy" plain="true" onclick="jump5()">重要部位登记</a>}}

					{{--<a class="easyui-linkbutton" iconCls="icon-tip" plain="true" onclick="jq()">警情通报</a>}}

						{{--<a class="easyui-linkbutton" iconCls="icon-tip" plain="true" onclick="rysh()">人员审核</a>}}




				<!-- 	<a class="easyui-linkbutton" iconCls="icon-tip" plain="true" onclick="jq()">警情通报</div> -->


					{{--<a class="easyui-linkbutton" iconCls="icon-af" plain="true" onclick="jump6()">安防设施</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-yj" plain="true" onclick="jump7()">应急预案</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-jq" plain="true" onclick="jump8()">警情上报</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-aj" plain="true" onclick="jump9()">安全检查</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-zd" plain="true" onclick="jump10()">保卫制度</a>--}}
					{{--<a class="easyui-linkbutton" iconCls="icon-jl" plain="true" onclick="jump11()">历史变更记录</a>--}}
					{{--@if(Auth::guard('admin')->user()->role_id != 22)
						<a class="easyui-linkbutton" iconCls="icon-zd" plain="true" onclick="jump12()">发送信息</a>
					@else
						<a class="easyui-linkbutton" iconCls="icon-zd" plain="true" onclick="jump12()">查看信息</a>
					@endif--}}
					{{--@if(Auth::guard('admin')->user()->role_id == 15)
						<a class="easyui-linkbutton" iconCls="icon-bw" plain="true" onclick="jump13()">认领</a>
						<a class="easyui-linkbutton" iconCls="icon-bw" plain="true" onclick="jump14()">释放</a>
					@endif--}}
				</div>
				<table id="dg" title="单位列表" class="easyui-datagrid" style="width:100%;height:600px"
						data-options="rownumbers:true,singleSelect:true,pagination:true,pageSize:20,url:'{{url('admin/units/index')}}',method:'get',toolbar:'#tb'">
					<thead>
						<tr>
							<th data-options="field:'city'" width="5%" align="center">市</th>
							<th data-options="field:'area'" width="10%" align="center">区</th>
							<th data-options="field:'org_id'" width="10%" align="center">所属派出所</th>
							<th data-options="field:'is_imp'" width="5%" align="center">重点级别</th>
							<th data-options="field:'type'" width="12%" align="center">企业类型</th>
							<th data-options="field:'xingzhi'" width="8%" align="center">企业性质</th>
							<th data-options="field:'name'" width="15%" align="center">单位名</th>
							<th data-options="field:'address'" width="15%" align="center">详细地址</th>
							<th data-options="field:'frdb_name'" width="10%" align="center">联系人</th>
							<th data-options="field:'frdb_phone'" width="11%" align="center">联系电话</th>
							{{--<th data-options="field:'id',formatter:formatAction" width="10%" align="center">操作</th>--}}
						</tr>
					</thead>
				</table>
		  </div>
		</div>

	</div>

	<!--新增-->
	<div id="w" class="easyui-window" closed="true" style="width:900px;height:600px;padding:10px;"></div>
	<div id="jwd" class="easyui-window" closed="true" title="新增" data-options="iconCls:'icon-save'" style="width:800px;height:600px;padding:10px;">
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hrVnXxLAGVr6QZ0rt9MaxU8bBkwKzyQC"></script>
	</div>
	<!--编辑-->
	<!--注销-->
	<div id="dlg" class="easyui-dialog" title="注销" closed="true" style="width:400px;height:200px;line-height:100px;text-align:center;font-size:16px;padding:10px">
		您确定要注销该单位？
	</div>
	<!--设为重点单位-->
	<div id="unit" class="easyui-dialog" data-options="closed:true,iconCls:'icon-save'" style="width:300px;height:150px;padding:10px;">
		<form id="unit_form" method="post">
			<table>
				<tr>
					<td width="60" align="right">级 别：&nbsp;&nbsp;&nbsp;&nbsp;</td>
					<td>
						<select class="easyui-combobox" name="is_imp" id="is_imp" style="width:200px;">
							<option value="0">取消重点</option>
							<option value="1">省级</option>
							<option value="2">市级</option>
							<option value="3">县级</option>
							<option value="4">乡级</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
	</div>

	<div id="menu" class="easyui-menu" style="width:200px;">
		<div onclick="edit()" iconCls="icon-edit">编辑</div>
		<div onclick="cancel()" iconCls="icon-undo">注销</div>
		{{--<div onclick="st()" iconCls="icon-tip">设为重点单位</div>--}}
		<div onclick="jump1()" iconCls="icon-save">法人登记</div>
		<div iconCls="icon-bw" onclick="jump2()">保卫人员登记</div>
		<div iconCls="icon-zd" onclick="jump3()">重点岗位人员登记</div>
		{{--<div iconCls="icon-jg" onclick="jump4()">保卫机构</div>--}}
		<div iconCls="icon-zy" onclick="jump5()">重要部位登记</div>

		
		<div iconCls="icon-tip" onclick="jump5()">警情通报</div>

		{{--<div iconCls="icon-af" onclick="jump6()">安防设施</div>--}}
		{{--<div iconCls="icon-yj" onclick="jump7()">应急预案</div>--}}
		{{--<div iconCls="icon-jq" onclick="jump8()">警情上报</div>--}}
		{{--<div iconCls="icon-aj" onclick="jump9()">安全检查</div>--}}
		{{--<div iconCls="icon-zd" onclick="jump10()">保卫制度</div>--}}
		{{--<div iconCls="icon-jl" onclick="jump11()">历史变更记录</div>--}}
		{{--@if(Auth::guard('admin')->user()->role_id != 22)
			<div iconCls="icon-zd" onclick="jump12()">发送信息</div>
		@else
			<div iconCls="icon-zd" onclick="jump12()">查看信息</div>
		@endif--}}
	</div>
	@endif

	<script type="text/javascript">
		function getjwd(){
			$('#jwd').window({
				title: "获取经纬度",
				href: 'getjwd',
				width:'700',
				height:'600',
				top:($(window).height() - 600) * 0.5,
				left:($(window).width() - 700) * 0.1,
				modal:true,
				closed: false,
			});
		}
		/*function formatAction(value,row,index){
			return '<a href="'+'edit/'+value+'" target="_blank">编辑</a>';
		}*/
		/*window.onload = function(){
			doSearch();
		}*/
		//搜索
		function doSearch(){
			$('#dg').datagrid('load',{
				city: $("input[name='city']").val(),
				area: $("input[name='area']").val(),
				org_id: $("input[name='org_id']").val(),
				name: $("input[name='name']").val(),
				frdb_name: $("input[name='frdb_name']").val(),
				type: $("select[name='type']").val(),
				is_renling:$("select[name='is_renling']").val(),
				jibie:$("select[name='jibie']").val(),
			});
		}


		function load_city_data_from_menu($id){
			$('#dg').datagrid('load',{
				city: $id,
			});
			$("input[name='city']").val($id);
			//$("input[name='area']").val('');
			//$("input[name='org_id']").val('');
		}

		function load_area_data_from_menu($id){
			$('#dg').datagrid('load',{
				area: $id,
			});
			//$("input[name='city']").val('');
			$("input[name='area']").val($id);
			//$("input[name='org_id']").val('');
		}
		function load_org_data_from_menu($id){
			$('#dg').datagrid('load',{
				org_id: $id,
			});
			//$("input[name='city']").val('');
			//$("input[name='area']").val('');
			$("input[name='org_id']").val($id);
		}
	</script>

	<script type="text/javascript">
		function export_unit(){
			var city = $("input[name='city']").val();
			var	area = $("input[name='area']").val();
			var org_id = $("input[name='org_id']").val();
			var	name = $("input[name='name']").val();
			var	frdb_name = $("input[name='frdb_name']").val();
			var	type = $("select[name='type']").val();
			var	jibie = $("select[name='jibie']").val();
			var url = "{{url('admin/units/export_unit')}}";
			//window.location.href = url+'?&status='+status+'&major_id='+major_id+'&add_time='+add_time;
			window.location.href = url+'?&city='+city+'&area='+area+'&org_id='+org_id+'&name='+name+'&frdb_name='+frdb_name+'&type='+type+'&jibie='+jibie;
		}
		function print(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				window.open("{{url('admin/units/print_unit')}}"+"/"+row.id);
			} else {
				$.messager.alert('提示','请选择要打印的企业！');
			}
		}
		function add(){
			$('#w').window({
				title: "新增",
				href: 'add',
				width:'900',
				height:'600',
				top:($(window).height() - 600) * 0.5,
				left:($(window).width() - 900) * 0.5,
				modal:true,
				closed: false,
				minimizable:false,
			});
		}
		function edit(){
			$('#w').html('');
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = '/admin/qyph/leida/'+row.id;
				$('#w').window({
					title: "雷达图",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中要编辑的行！');
			}
		}


			//警情通报
			function jq(){
				$('#w').html('');
				var row = $('#dg').datagrid('getSelected');
				if (row) {
				var url = '/admin/jq/police/'+row.id;
				$('#w').window({
					title: "警情回复",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选择要查看的企业！');
			}
		}


			//人员审核
			function rysh(){
				$('#w').html('');
				var row = $('#dg').datagrid('getSelected');
				if (row) {
				var url = '/admin/rysh/police/'+row.id;
				$('#w').window({
					title: "核查回复",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选择要查看的企业！');
			}

		}
		function cancel(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				$('#dlg').dialog({
					title: "注销",
					closed: false,
					modal:true,
					buttons: [{
						text: '确定',
						iconCls: 'icon-ok',
						handler: zhuxiao
					}, {
						text: '取消',
						iconCls: 'icon-cancel',
						handler: function () {
							$('#dlg').dialog('close');
						}
					}]
				});
			} else {
				$.messager.alert('提示','请选中要编辑的行！');
			}
		}
		function zhuxiao(){
			$('#dlg').dialog('close');
			var row = $('#dg').datagrid('getSelected');
			var url = 'zhuxiao/'+row.id;
			$.ajax({
				type: 'get',
				url: url,
				success: function(data){
					if(data.status == 1){
						$.messager.alert('信息提示',data.msg,'info');
						$('#unit').dialog('close');
						var rowIndex = $('#dg').datagrid('getRowIndex', row);
						$('#dg').datagrid('deleteRow', rowIndex);
					}else{
						$.messager.alert('信息提示',data.msg,'info');
					}
				}
			});
		}
		function st(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				$('#unit').dialog({
					title: "重点级别设置",
					closed: false,
					modal:true,
					buttons: [{
						text: '确定',
						iconCls: 'icon-ok',
						handler: zhongdian
					}, {
						text: '取消',
						iconCls: 'icon-cancel',
						handler: function () {
							$('#unit').dialog('close');
						}
					}]
				});
			} else {
				$.messager.alert('提示','请选中要编辑的行！');
			}
		}
		function zhongdian(){
			var row = $('#dg').datagrid('getSelected');
			var jibie = $("#is_imp").val();
			var url = 'swzd/'+row.id+'/'+jibie;
			$.ajax({
				type: 'get',
				url: url,
				success: function(data){
					if(data.status == 1){
						$.messager.alert('信息提示',data.msg,'info');
						$('#unit').dialog('close');
						$('.pagination-load').click();
					}else{
						$.messager.alert('信息提示',data.msg,'info');
					}
				}
			});
		}
		//法人登记
		function jump1(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'faren/'+row.id;
				$('#w').window({
					title: "法人",
					href: url,
					width:'900',
					height:'600',
					minimizable:false,
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}

			$('#w').window({
				onMinimize: function () {
					$('#w').window('move', {
						left: "0%",
						top: "95%"
					}).window('collapse').window('open');
				}
			});
		}
		//保卫人员登记
		function jump2(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'baowei/'+row.id;
				$('#w').window({
					title: "保卫人员",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//重点人员登记
		function jump3(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'zdry/'+row.id;
				$('#w').window({
					title: "重点人员",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//保卫机构
		function jump4(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'jigou/'+row.id;
				$('#w').window({
					title: "保卫机构",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//重要部位
		function jump5(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'zybw/'+row.id;
				$('#w').window({
					title: "重要部位",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//安防设施
		function jump6(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'edit_anfang/'+row.id;
				$('#w').window({
					title: "安防设施",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//应急预案
		function jump7(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'tfsj/'+row.id;
				$('#w').window({
					title: "应急预案",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//警情上报
		function jump8(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'zdqk/'+row.id;
				$('#w').window({
					title: "警情上报",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//安全检查
		function jump9(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'jiancha/'+row.id;
				$('#w').window({
					title: "安全检查",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//保卫制度
		function jump10(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'zhidu/'+row.id;
				$('#w').window({
					title: "保卫制度",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//历史记录
		function jump11(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'history/'+row.id;
				$('#w').window({
					title: "历史变更记录",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//信息列表
		function jump12(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'xinxi/'+row.id;
				$('#w').window({
					title: "信息列表",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//认领
		function jump13(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'renling/'+row.id;
				$.ajax({
					cache: true,
					type: "get",
					url: url,
					async: false,
					success: function(data) {
						if(data.status == 1){
							$.messager.alert('信息提示',data.msg,'info');
						}else{
							$.messager.alert('信息提示',data.msg,'info');
						}
					}
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		//释放
		function jump14(){
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = 'shifang/'+row.id;
				$.ajax({
					cache: true,
					type: "get",
					url: url,
					async: false,
					success: function(data) {
						if(data.status == 1){
							$.messager.alert('信息提示',data.msg,'info');
						}else{
							$.messager.alert('信息提示',data.msg,'info');
						}
					}
				});
			} else {
				$.messager.alert('提示','请选中一条记录！');
			}
		}
		$("#dg").datagrid({
			onRowContextMenu: function (e, rowIndex, rowData) {
				e.preventDefault();
				$(this).datagrid("clearSelections");
				$(this).datagrid("selectRow", rowIndex);
				$('#menu').menu('show', {
					left: e.pageX,
					top: e.pageY
				});
				e.preventDefault();
			}
		});
		$("#dg").datagrid({
			onDblClickRow: function (index, row) {
				tab();
			}
		});
		function tab(){
			$('#w').html('');
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				var url = '/admin/qyph/leida/'+row.id;
				$('#w').window({
					title: "雷达图",
					href: url,
					width:'900',
					height:'600',
					top:($(window).height() - 600) * 0.5,
					left:($(window).width() - 900) * 0.5,
					modal:true,
					closed: false,
					minimizable:false,
				});
			} else {
				$.messager.alert('提示','请选中要编辑的行！');
			}
		}

	</script>

@stop
